import numpy as np
import matplotlib.pyplot as plt

# -----------------------------------------------------------------------------
# MESURES EXPÉRIMENTALES
# -----------------------------------------------------------------------------

θ = [] # Angle entre les polariseurs (en degré)
u = [] # Tension aux bornes de la photodiode


# -----------------------------------------------------------------------------
# RÉGRESSION LINÉAIRE
# -----------------------------------------------------------------------------

# Conversion des listes en array
θ = np.array(θ) * np.pi/180
u = np.array(u)
x = np.cos(θ)**2



# -----------------------------------------------------------------------------
# AFFICHAGE GRAPHIQUE
# -----------------------------------------------------------------------------

fig, ax = plt.subplots()
ax.grid(True)

ax.plot(x, u, 'bo', label='Données expérimentales')

ax.legend()